#pragma once

#include "lg.h"
#include "lg_init.h"


struct LGWindow {
    LGWindowStyle style;
    unsigned width;
    unsigned height;
    char title[256];
    LGWindow* next;
    void* ud;

    int mousePosition[2];
    void (*onEvt)(LGWindow*, LGWindowEvt evt);
};

struct LGWindowBackend{
    size_t (*sizeofWindow)();
    int (*openWindow)(LGWindow* window);
    int (*closeWindow)(LGWindow* window);
    int (*setParent)(LGWindow* window, LGWindow* parent);
    int (*drawCanvas)(LGWindow* window, void* canvas);
    void (*renderWindow)(LGWindow*, LGCanvas* canvas);
};

LG_API int
lgInitWindowContext(LGConfig* config, LGWindowBackend* backend);

LG_API int
lgExitWindowContext();